﻿$(document).ajaxStop($.unblockUI);

$("#contact_submit").click(
  function () {
      var validator = $("#contact_form").bind("invalid-form.validate", function () {

      }).validate({
          debug: true,
          errorElement: "em",
          errorPlacement: function (error, element) {
              error.appendTo(element.prev());
          },
          success: function (label) {
          },
          rules: {
              contact_your_email: {
                  required: true,
                  email: true
              },
              contact_your_name: {
                  required: true,
                  minlength: 6
              },
              contact_your_phone: {
                  required: true,
                  minlength: 6
              },
              contact_comment: {
                  required: true,
                  minlength: 6
              }
          },
          messages: {
          },
          submitHandler: function (form) {
              $.blockUI({ message: "<h2><img class='busyprocess' src='/files/themes/Astro/images/busy.gif'>Loading...</h2>" });
              AstroRecruitment.SubmitContactUs('/__utility/ajax/astro.ashx');
          }
      });
  });